<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
<span></span>
<div>
    <button onclick="f1()">弹出警告框</button>
    <button onclick="f2()">弹出确认框</button>
    <button onclick="f3()">弹出提示输入框</button>
    <button onclick="f4()">location.href</button>
    <button onclick="f5()">location.reload</button>
</div>
<script>
   let span= document.querySelector("span");
   span.innerHTML=new Date();
    function f1() {
        alert('警告框');
    }
    function f2() {
       let flag=confirm('您确认要删除吗?');
       if(flag){
           alert('删除成功');
       }else{
           alert('删除失败');
       }
    }
    function f3() {
       let result= prompt('请输入会员卡号:')
       alert(result);
    }
    function f4(){
        location.href="https://www.baidu.com"
    }
    function f5(){
        location.reload();//刷新整个页面
    }

</script>
</body>
</html>